package com.ktg.mes.pro.domain;

import java.awt.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ktg.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.TreeEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 生产工单对象 pro_workorder
 *
 * @author yinjinlu
 * @date 2022-05-15
 */

@Data
@Accessors(chain = true)
@TableName("pro_workorder")
public class ProWorkorder extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    public static final String mainSelectColumnNotId = "batch_code,tag,bucket_code,tag_date";

    /** 父菜单名称 */
    @TableField(exist = false)
    private String parentName;

    /** 父菜单ID */
    private Long parentId;

    /** 显示顺序 */
    @TableField(exist = false)
    private Integer orderNum;

    /** 祖级列表 */
    private String ancestors;

    /** 子部门 */
    @TableField(exist = false)
    private List<?> children = new ArrayList<>();

    /** 工单ID */
    @TableId(value = "workorder_id")
    private Long workorderId;

    /** 工单编码 */
    @Excel(name = "工单编码")
    private String workorderCode;

    /** 工单名称 */
    @Excel(name = "工单名称")
    private String workorderName;

    /** 来源类型 */
    @Excel(name = "来源类型")
    private String orderSource;

    /** 来源单据 */
    @Excel(name = "来源单据")
    private String sourceCode;

    /** 产品ID */
    @Excel(name = "产品ID")
    private Long productId;

    /** 产品编号 */
    @Excel(name = "产品编号")
    private String productCode;

    /** 产品名称 */
    @Excel(name = "产品名称")
    private String productName;

    /** 产品标签 */
    @Excel(name = "产品标签")
    private String tag;

    /** 规格型号 */
    @Excel(name = "规格型号")
    private String productSpc;

    /** 单位 */
    @Excel(name = "单位")
    private String unitOfMeasure;

    /** 批次号 */
    @Excel(name = "批次号")
    private String batchCode;

    /** 生产数量(重量) */
    @Excel(name = "生产数量(重量)")
    private BigDecimal quantity;

    /**粘度*/
    @Excel(name = "粘度", width = 15)
    @ApiModelProperty(value = "粘度")
    private String viscosity;

    @Excel(name = "包装规格", width = 15)
    @ApiModelProperty(value = "包装规格")
    private String packingType;

    /** 已生产数量 */
    @Excel(name = "已生产数量")
    private BigDecimal quantityProduced;

    /** 调整数量 */
    @Excel(name = "调整数量")
    private BigDecimal quantityChanged;

    /** 已排产数量 */
    @Excel(name = "已排产数量")
    private BigDecimal quantityScheduled;

    /** 客户ID */
    @Excel(name = "客户ID")
    private Long clientId;

    /** 客户编码 */
    @Excel(name = "客户编码")
    private String clientCode;

    /** 客户名称 */
    @Excel(name = "客户名称")
    private String clientName;

    /** 需求日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date requestDate;

    /** 单据状态  状态包含：代排产 + 排产任务的 taskStatus ，排产状态的 taskStatus 会回写到此处*/
    @Excel(name = "单据状态 ")
    private String status;

    /** 标签类型 */
    @Excel(name = "标签类型")
    private Integer tagType;

    /** 标签日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "标签日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date tagDate;

    /** 桶数 */
    @Excel(name = "桶数")
    private Integer barrelage;

    /** 桶号 */
    @Excel(name = "桶号")
    private String bucketCode;

    /** 拆分步骤 */
    @Excel(name = "拆分步骤")
    private String splitIds;

    /** 拆分父工单id */
    @Excel(name = "拆分父工单id")
    private Long parentWorkorderId;


    /** 拆分父排产id */
    @Excel(name = "拆分父排产id")
    private Long parentTaskId;

    /** 拆分前工艺流程序号 */
    @Excel(name = "拆分前工艺流程")
    private String parentRouteIdIds;

    /** 拆分前工艺流程序号 */
    @Excel(name = "拆分前工艺流程序号")
    private String parentRouteIndexs;


    /** 拆分后工艺流程id */
    @Excel(name = "拆分后工艺流程id")
    private Long prorouteId;

    /** 预留字段1 */
    private String attr1;

    /** 预留字段2 */
    private String attr2;

    /** 预留字段3 */
    private Long attr3;

    /** 预留字段4 */
    private Long attr4;

    @TableField(exist = false)
    private float inCount;

    public void setWorkorderId(Long workorderId)
    {
        this.workorderId = workorderId;
    }

    public Long getWorkorderId()
    {
        return workorderId;
    }
    public void setWorkorderCode(String workorderCode)
    {
        this.workorderCode = workorderCode;
    }

    public String getWorkorderCode()
    {
        return workorderCode;
    }
    public void setWorkorderName(String workorderName)
    {
        this.workorderName = workorderName;
    }

    public String getWorkorderName()
    {
        return workorderName;
    }
    public void setOrderSource(String orderSource)
    {
        this.orderSource = orderSource;
    }

    public String getOrderSource()
    {
        return orderSource;
    }
    public void setSourceCode(String sourceCode)
    {
        this.sourceCode = sourceCode;
    }

    public String getSourceCode()
    {
        return sourceCode;
    }
    public void setProductId(Long productId)
    {
        this.productId = productId;
    }

    public Long getProductId()
    {
        return productId;
    }
    public void setProductCode(String productCode)
    {
        this.productCode = productCode;
    }

    public String getProductCode()
    {
        return productCode;
    }
    public void setProductName(String productName)
    {
        this.productName = productName;
    }

    public String getProductName()
    {
        return productName;
    }
    public void setProductSpc(String productSpc)
    {
        this.productSpc = productSpc;
    }

    public String getProductSpc()
    {
        return productSpc;
    }
    public void setUnitOfMeasure(String unitOfMeasure)
    {
        this.unitOfMeasure = unitOfMeasure;
    }

    public String getUnitOfMeasure()
    {
        return unitOfMeasure;
    }
    public void setQuantity(BigDecimal quantity)
    {
        this.quantity = quantity;
    }

    public BigDecimal getQuantity()
    {
        return quantity;
    }
    public void setQuantityProduced(BigDecimal quantityProduced)
    {
        this.quantityProduced = quantityProduced;
    }

    public BigDecimal getQuantityProduced()
    {
        return quantityProduced;
    }
    public void setQuantityChanged(BigDecimal quantityChanged)
    {
        this.quantityChanged = quantityChanged;
    }

    public BigDecimal getQuantityChanged()
    {
        return quantityChanged;
    }
    public void setQuantityScheduled(BigDecimal quantityScheduled)
    {
        this.quantityScheduled = quantityScheduled;
    }

    public BigDecimal getQuantityScheduled()
    {
        return quantityScheduled;
    }
    public void setClientId(Long clientId)
    {
        this.clientId = clientId;
    }

    public Long getClientId()
    {
        return clientId;
    }
    public void setClientCode(String clientCode)
    {
        this.clientCode = clientCode;
    }

    public String getClientCode()
    {
        return clientCode;
    }
    public void setClientName(String clientName)
    {
        this.clientName = clientName;
    }

    public String getClientName()
    {
        return clientName;
    }
    public void setRequestDate(Date requestDate)
    {
        this.requestDate = requestDate;
    }

    public String getBatchCode() {
        return batchCode;
    }

    public void setBatchCode(String batchCode) {
        this.batchCode = batchCode;
    }

    public Date getRequestDate()
    {
        return requestDate;
    }
    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }
    public void setTagType(Integer tagType) { this.tagType = tagType; }

    public Integer getTagType() { return tagType; }
    public void setTagDate(Date tagDate) { this.tagDate = tagDate; }

    public Date getTagDate() { return tagDate; }
    public void setBarrelage(Integer barrelage) { this.barrelage = barrelage; }

    public Integer getBarrelage() { return barrelage; }
    public void setBucketCode(String bucketCode) { this.bucketCode = bucketCode; }

    public String getBucketCode() { return bucketCode; }
    public void setSplitIds(String splitIds) { this.splitIds = splitIds; }

    public String getSplitIds() { return splitIds; }
    public void setParentWorkorderId(Long parentWorkorderId) { this.parentWorkorderId = parentWorkorderId; }

    public Long getParentWorkorderId() { return parentWorkorderId; }
    public void setProrouteId(Long prorouteId) { this.prorouteId = prorouteId; }

    public Long getProrouteId() { return prorouteId; }
    public void setAttr1(String attr1)
    {
        this.attr1 = attr1;
    }

    public String getAttr1()
    {
        return attr1;
    }
    public void setAttr2(String attr2)
    {
        this.attr2 = attr2;
    }

    public String getAttr2()
    {
        return attr2;
    }
    public void setAttr3(Long attr3)
    {
        this.attr3 = attr3;
    }

    public Long getAttr3()
    {
        return attr3;
    }
    public void setAttr4(Long attr4)
    {
        this.attr4 = attr4;
    }

    public Long getAttr4()
    {
        return attr4;
    }

    public String getViscosity() {
        return viscosity;
    }

    public void setViscosity(String viscosity) {
        this.viscosity = viscosity;
    }

    public String getPackingType() {
        return packingType;
    }

    public void setPackingType(String packingType) {
        this.packingType = packingType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("workorderId", getWorkorderId())
            .append("workorderCode", getWorkorderCode())
            .append("workorderName", getWorkorderName())
            .append("orderSource", getOrderSource())
            .append("sourceCode", getSourceCode())
            .append("productId", getProductId())
            .append("productCode", getProductCode())
            .append("productName", getProductName())
            .append("productSpc", getProductSpc())
            .append("viscosity", getViscosity())
            .append("packingType", getPackingType())
            .append("unitOfMeasure", getUnitOfMeasure())
            .append("quantity", getQuantity())
            .append("quantityProduced", getQuantityProduced())
            .append("quantityChanged", getQuantityChanged())
            .append("quantityScheduled", getQuantityScheduled())
            .append("clientId", getClientId())
            .append("clientCode", getClientCode())
            .append("clientName", getClientName())
            .append("requestDate", getRequestDate())
            .append("parentId", getParentId())
            .append("ancestors", getAncestors())
            .append("status", getStatus())
            .append("remark", getRemark())
            .append("attr1", getAttr1())
            .append("attr2", getAttr2())
            .append("attr3", getAttr3())
            .append("attr4", getAttr4())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("tagType", getTagType())
            .append("tagDate", getTagDate())
            .append("barrelage", getBarrelage())
            .append("bucketCode", getBucketCode())
            .toString();
    }
}
